//
//  MoreViewController.m
//  ShareNavigation
//
//  Created by 水木 傅 on 12-5-4.
//  Copyright (c) 2012年 __MyCompanyName__. All rights reserved.
//

#import "MoreViewController.h"
#import "SingletonUser.h"


@implementation MoreViewController
@synthesize signOutButton;

-(void)viewDidLoad
{
    [self signOutButton].enabled = [SingletonUser shareManager].HasLogin;
}

- (IBAction)signOut:(id)sender {
    UIAlertView *alert;
    alert = [[UIAlertView alloc]
             initWithTitle:@""
             message:@"是否确定注销"
             delegate:self
             cancelButtonTitle:@"返回"
             otherButtonTitles:@"确定",nil];
    [alert show];    
}
- (void)viewDidUnload {
    [self setSignOutButton:nil];
    [super viewDidUnload];
}

#pragma ---  实现delegate中的方法  ----

-(void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex
{
    if(buttonIndex == 1)
    {
        
        [SingletonUser shareManager].HasLogin = FALSE;
        [SingletonUser shareManager].UserID = @"";
        [SingletonUser shareManager].PassWord = @"";
        [SingletonUser shareManager].HeadPhoto = @"";
        
        [self.navigationController popViewControllerAnimated:YES];
    }
}

@end
